package com.chenqi.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chenqi.model.entity.Post;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description: post数据层
 * @program: ardaicommunity
 * @author: ChenQi
 * @create: 2021-03-2021/3/11-14-28
 */
@Repository
public interface PostMapper extends BaseMapper<Post> {
    /**
     * 分页查询某个专栏的信息
     * @param page
     * @param rows
     * @param sectionId
     * @return
     */
    List<Post> getPostByPage(@Param("page") Integer page, @Param("rows") Integer rows, @Param("sectionId") Integer sectionId);

    /**
     * 根据id查询某个文章
     * @param id
     * @return
     */
    Post getPostById(Integer id);

    /**
     * 获取推荐
     * @return
     */
    List<Post> recommend();
}
